// Convert px to em
// https://css-tricks.com/snippets/sass/px-to-em-functions/
// $base-font-size is defined in './_settings.sizes.scss'
@function em($pixels, $context: $base-font-size) {
  @if (unitless($pixels)) {
    $pixels: $pixels * 1px;
  }

  @if (unitless($context)) {
    $context: $context * 1px;
  }

  @return $pixels / $context * 1em;
}


// Convert px to rem
@function rem($pixels) {
  @if (unitless($pixels)) {
    $pixels: $pixels * 1px;
  }

  @return $pixels / $base-font-size * 1rem;
}


// Vertical paddings
@function vertical-offset($outer-height, $line-height, $offset: 0) {
  @return ($outer-height - $offset - $line-height) / 2;
}
